package com.dl.code.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dl.code.entity.RolePermission;
import com.dl.code.mapper.RolePermissionMapper;
import com.dl.code.service.RolePermissionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * 作者: DL代先生
 * 日期: 2021/5/29
 * 时间: 23:48
 * 内容: Shiro与springboot整合教程！
 * 描述:
 */
@Service
public class RolePermissionServiceImpl implements RolePermissionService {

    @Resource
    private RolePermissionMapper rolePermissionMapper;

    @Override
    public List<RolePermission> selectAllRolePermissions(Integer roleId) {
        QueryWrapper<RolePermission> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("role_id",roleId);
        List<RolePermission> rolePermissionList = rolePermissionMapper.selectList(queryWrapper);
        return rolePermissionList;
    }
}
